<!--{template common/header}-->

<style type="text/css">
.xinruiMobileForm{padding:20px;}
.xinruiMobileForm li{margin-bottom:10px;position:relative;}
.xrMobileInpt{width:100%;padding:5px;border:solid 1px #ebebeb;box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box;border-radius:3px;background:#fff;height:40px;line-height:30px;font-size:14px;}
.xrLoginLi{margin:20px 0;}
.xrMobileBtn{background:#3f9f5f; border-radius:3px; width:100%; height:40px; display:block; line-height:40px; overflow:hidden; color:#fff; text-align:center;border:0;font-size:16px;}
.mobileVer{background:#3f9f5f;position:absolute;top:5px;right:5px;font-size:12px;color:#fff;border:none;padding:0 5px;height:30px;border-radius:3px;}
</style>

<!--{if $_GET['op'] == 'mlogin'}-->
<header class="header">
	<a href="javascript:;" onclick="history.go(-1)" class="goBack z"></a>
	<h1 id="return_$_GET['handlekey']">{$_G["XRLANG_MOBLIEREG"]["login_pc_mobile2"]}</h1>
</header>
<div class="xinruiMobileForm"> 
	<form id="confirmform" method="post" autocomplete="off" action="plugin.php?id=xinrui_mobilereg&mod=setting&op=login&allsubmit=yes&flag=yes&confirmsubmit=yes&handlekey=login" onsubmit="ajaxpost('confirmform', 'return_$_GET['handlekey']', 'return_$_GET['handlekey']', 'onerror'); return false;">
		 <!--{if !empty($_GET['infloat'])}--><input type="hidden" name="handlekey" value="$_GET['handlekey']" /><!--{/if}-->
		 <input type="hidden" name="formhash" value="{FORMHASH}" />
		 <input type="hidden" name="referer" value="/" />
		 <ul>
			<li><input type="text" id="phone" name="phone" placeholder="{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile']}" class="xrMobileInpt" tabindex="1" /></li>
			<li><input type="password" placeholder="{$_G['XRLANG_MOBLIEREG']['login_pc_mobile17']}" id="pwd" name="pwd" class="xrMobileInpt" tabindex="1" /></li>
			<li class="xrLoginLi"><button class="xrMobileBtn" type="submit" name="confirmsubmit" value="true" tabindex="1">{lang submit}</button></li>
		</ul>
		<div class="cl cfix">
			<a class="z" href="plugin.php?id=xinrui_mobilereg&mod=setting&op=mreg">{$_G["XRLANG_MOBLIEREG"]["reg_pc_mobile10"]}</a>
			<a class="y" href="plugin.php?id=xinrui_mobilereg&mod=setting&op=mupt">{$_G['XRLANG_MOBLIEREG']['login_pc_mobile3']}</a>
		</div>
	</form>
</div>
<!--{/if}-->

<!--{if $_GET['op'] == 'mreg'}-->
<header class="header">
	<a href="javascript:;" onclick="history.go(-1)" class="goBack z"></a>
	<h1 id="return_$_GET['handlekey']">{$_G["XRLANG_MOBLIEREG"]["reg_pc_mobile10"]}</h1>
</header>
<div class="xinruiMobileForm"> 
<form id="confirmform" method="post" autocomplete="off" action="plugin.php?id=xinrui_mobilereg&mod=setting&op=register&confirmsubmit=yes&handlekey=reg&inajax=1">
	 <!--{if !empty($_GET['infloat'])}--><input type="hidden" name="handlekey" value="$_GET['handlekey']" /><!--{/if}-->
	 <input type="hidden" name="formhash" value="{FORMHASH}" />
	 <input type="hidden" name="referer" value="/" />
	 <ul>
		<li><input type="text" id="phone" name="phone" placeholder="{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile']}" class="xrMobileInpt" tabindex="1" />
			<button id="pc_reg_get_verify" class="mobileVer" type="button" data="1">{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile2']}</button>
		</li>		
		<li><input type="text" id="verfiy" name="verfiy" placeholder="{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile3']}" class="xrMobileInpt" tabindex="1" /></li>
		<li><input type="password" id="passwd" name="passwd" placeholder="{$_G['XRLANG_MOBLIEREG']['login_pc_mobile6']}" class="xrMobileInpt" tabindex="1" /></li>
		<li><input type="password" id="passwd_2" name="passwd_2" placeholder="{$_G['XRLANG_MOBLIEREG']['login_pc_mobile7']}" class="xrMobileInpt" tabindex="1" /></li>
		<li class="xrLoginLi"><button class="xrMobileBtn" type="submit" name="sub" id="sub" value="true" tabindex="1">{lang submit}</button></li>
	</ul>
	<div class="cl cfix">
		<a class="z" href="plugin.php?id=xinrui_mobilereg&mod=setting&op=mlogin">{$_G["XRLANG_MOBLIEREG"]["login_pc_mobile2"]}</a>
		<a class="y" href="plugin.php?id=xinrui_mobilereg&mod=setting&op=mupt">{$_G['XRLANG_MOBLIEREG']['login_pc_mobile3']}</a>
	</div>
</form>
</div>
<script>
$('#pc_reg_get_verify').on("click",function(){
	var phone = $('#phone').val();
	var mobile_tel = /^1[3|4|5|7|8][0-9]\d{8}$/;
	if(phone == ''){
		alert("{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile11']}");	
		return ;
	}
	if(mobile_tel.test(phone)){
		$.post('plugin.php?id=xinrui_mobilereg&mod=setting&op=msendcode&infloat=yes&handlekey=register&phone='+phone, {inajax: 1}, function(s) {
			popup.open(s.lastChild.firstChild.nodeValue);
		}, 'xml');
	
	}else{
		alert("{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile12']}");	
	}
	return ;	
});

$("#sub").on('click',function() {
	popup.open('<img src="' + IMGDIR + '/imageloading.gif">');
	var obj = $(this);
	var formobj = $(this.form);
	$.ajax({
		type: 'POST',
		url: formobj.attr('action') + '&handlekey=' + formobj.attr('id') + '&inajax=1',
		data: formobj.serialize(),
		dataType: 'xml'
	}).success(function(s) {
		popup.open(s.lastChild.firstChild.nodeValue);
		evalscript(s.lastChild.firstChild.nodeValue);
		window.setTimeout("popup.close()", 3000);
	}).error(function() {
		popup.open(s.lastChild.firstChild.nodeValue);
		evalscript(s.lastChild.firstChild.nodeValue);
		window.setTimeout("popup.close()", 3000);
	});
	return false;
});

</script>
<!--{/if}-->

<!--{if $_GET['op'] == 'mupt'}-->
<header class="header">
	<a href="javascript:;" onclick="history.go(-1)" class="goBack z"></a>
	<h1 id="return_$_GET['handlekey']">{$_G["XRLANG_MOBLIEREG"]["login_pc_mobile3"]}</h1>
</header>
<div class="xinruiMobileForm">
<form id="mobilelostpw" name="mobilelostpw" method="post" autocomplete="off" action="plugin.php?id=xinrui_mobilereg&mod=setting&op=getmobile&confirmsubmit=yes&infloat=yes&handlekey=logging&inajax=1" >
	 <input type="hidden" name="formhash" value="{FORMHASH}" />
	 <input type="hidden" name="referer" value="/" />
	 <ul>
		<li><input type="text" id="phone" name="phone" placeholder="{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile']}" class="xrMobileInpt" tabindex="1" /></li>
		<li><input type="text" id="verfiy" name="verfiy" placeholder="{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile3']}" class="xrMobileInpt" tabindex="1" />
			<button id="pc_reg_get_verify" class="mobileVer" type="button" data="1">{$_G["XRLANG_MOBLIEREG"]["reg_pc_mobile2"]}</button>
		</li>
		<li class="xrLoginLi"><button class="xrMobileBtn sub" type="button" name="sub" value="true" tabindex="1">{$_G["XRLANG_MOBLIEREG"]["login_pc_mobile8"]}</button></li>
	</ul>
	<div class="cl cfix">
		<a class="z" href="plugin.php?id=xinrui_mobilereg&mod=setting&op=mreg">{$_G['XRLANG_MOBLIEREG']['login_pc_mobile18']}</a>
		<a class="y" href="plugin.php?id=xinrui_mobilereg&mod=setting&op=mupt">{$_G['XRLANG_MOBLIEREG']['login_pc_mobile3']}</a>
	</div>
</form>



<form id="mobilelostpw2" name="mobilelostpw2" method="post" autocomplete="off" action=" plugin.php?id=xinrui_mobilereg&mod=setting&op=uptpwd&infloat=yes&confirmsubmit=yes&inajax=1&handlekey=logging" style=" display:none;">
	 <input type="hidden" name="formhash" value="{FORMHASH}" />
	 <input type="hidden" name="referer" value="/" />
	 <ul>
		<li><input type="password" id="password" name="password" placeholder="{$_G['XRLANG_MOBLIEREG']['login_pc_mobile6']}" class="xrMobileInpt" tabindex="1" /></li>
		<li><input type="password" id="password2" name="password2" placeholder="{$_G['XRLANG_MOBLIEREG']['login_pc_mobile7']}" class="xrMobileInpt" tabindex="1" /></li>
		</li>
		<li class="xrLoginLi"><button class="xrMobileBtn sub2" type="button" name="sub"  value="true" tabindex="1">{lang submit}</button></li>
	</ul>
	<div class="cl cfix">
		<a class="z" href="plugin.php?id=xinrui_mobilereg&mod=setting&op=mreg">{$_G['XRLANG_MOBLIEREG']['login_pc_mobile18']}</a>
		<a class="y" href="plugin.php?id=xinrui_mobilereg&mod=setting&op=mupt">{$_G['XRLANG_MOBLIEREG']['login_pc_mobile3']}</a>
	</div>
</form>

</div>
<script>

function removeHTMLTag(str) {
	str = str.replace(/window.location.href/g, 'var sib');
	return str;
}

function succeedhandle_logging(url,msg) {
	if(msg == '{$_G["XRLANG_MOBLIEREG"]["login_pc_mobile12"]}'){
		$("form[name='mobilelostpw']").hide();
		$("form[name='mobilelostpw2']").show();	
		return false ;
	}
	if(msg == '{$_G["XRLANG_MOBLIEREG"]["login_pc_mobile14"]}'){
		setTimeout(function () {
			location.href = url;
		}, '1000');
	}
}


$('#pc_reg_get_verify').on("click",function(){
	var phone = $('#phone').val();
	var mobile_tel = /^1[3|4|5|7|8][0-9]\d{8}$/;
	if(phone == ''){
		alert("{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile11']}");	
		return ;
	}
	if(mobile_tel.test(phone)){
		$.post('plugin.php?id=xinrui_mobilereg&mod=setting&op=msendcode&infloat=yes&handlekey=upt&phone='+phone, {inajax: 1}, function(s) {
			popup.open(s.lastChild.firstChild.nodeValue);
		}, 'xml');
	
	}else{
		alert("{$_G['XRLANG_MOBLIEREG']['reg_pc_mobile12']}");	
	}
	return ;	
});



$(".sub").on('click',function() {
	popup.open('<img src="' + IMGDIR + '/imageloading.gif">');
	var obj = $(this);
	var formobj = $(this.form);
	$.ajax({
		type: 'POST',
		url: formobj.attr('action') + '&handlekey=logging&inajax=1',
		data: formobj.serialize(),
		dataType: 'xml'
	}).success(function(s) {
		var str = s.lastChild.firstChild.nodeValue;
		if(str.indexOf('location') > 1){
			str = removeHTMLTag(str);
		}
		popup.open(str);
		evalscript(str);
		window.setTimeout("popup.close()", 2000);
	}).error(function() {
		
	});
	return false;
});

$(".sub2").on('click',function() {
	popup.open('<img src="' + IMGDIR + '/imageloading.gif">');
	var obj = $(this);
	var formobj = $(this.form);
	$.ajax({
		type: 'POST',
		url: formobj.attr('action') + '&handlekey=logging&inajax=1',
		data: formobj.serialize(),
		dataType: 'xml'
	}).success(function(s) {
		popup.open(s.lastChild.firstChild.nodeValue);
		evalscript(s.lastChild.firstChild.nodeValue);
	}).error(function() {
		
	});
	return false;
});

</script>
<!--{/if}-->

<!--{template common/footer}-->


